package deployment

import (
	"github.com/romberli/go-util/middleware"
)

type Repository interface {
	// Execute executes command with arguments on database
	Execute(command string, args ...interface{}) (middleware.Result, error)
	// Transaction returns middleware.Transaction
	Transaction() (middleware.Transaction, error)
	// GetServerHostInfo gets the das server host info with given deployment region, deployment org and network zone
	GetServerHostInfo(deploymentRegion, deploymentOrg, networkZone string) (string, error)
	// GetRemotePath gets the remote das path with given local path
	GetRemotePath(localPath string) (string, error)
}

type Service interface {
	// GetDASServerAddr gets the das server host info with given deployment region, deployment org and network zone
	GetDASServerAddr() (string, error)
	// CheckAccessibility checks if the das server is accessible to the mysql server
	CheckAccessibility() bool
	// PostDAS calls the das server, agent server should not call this method
	PostDAS(path string, data []byte) ([]byte, error)
}
